package com.orhon.smartcampus.modules.base.mm;


import java.util.List;

import org.mapstruct.InheritConfiguration;
import org.mapstruct.Mapper;
import org.mapstruct.Mapping;
import org.mapstruct.factory.Mappers;

import com.orhon.smartcampus.modules.base.entity.Grades;
import com.orhon.smartcampus.modules.base.gqlModel.GQLGrades;
import com.orhon.smartcampus.modules.student.mm.EclassMapper;

@Mapper(
        uses = {
                LangMapper.class,
                PeriodMapper.class,
                EclassMapper.class
        }
)
public interface GradeMapper {

    GradeMapper MAPPER = Mappers.getMapper(GradeMapper.class);


    @Mapping(source = "id" , target = "id")
    @Mapping(source = "gradeSlug" , target = "slug")
    @Mapping(source = "gradeNumber" , target = "number")
    @Mapping(source = "gradeOrder" , target = "order")
    @Mapping(source = "mark" , target = "mark")
    @Mapping(source = "createdAt" , target = "created_at")
    @Mapping(source = "updatedAt" , target = "updated_at")
    @Mapping(source = "deletedAt" , target = "deleted_at")
    @Mapping(source = "gradeName" , target = "name")//lang
    @Mapping(ignore = true, target = "periods")
    @Mapping(ignore = true, target = "teacher")
    @Mapping(ignore = true, target = "subjects")
   // @Mapping(ignore = true, target = "eclasses")
    GQLGrades toGrade(Grades entity);
    
    @InheritConfiguration(name = "toGrade")
    List<GQLGrades> toGradeList(List<Grades> entities);
}
